<template>
	<view class="wrap">
		<text>
			<rich-text :nodes="content"></rich-text>
		</text>
	</view>
</template>

<script>
	import {
		userAgree,
	} from "../../api/login.js"
	export default {
		data() {
			return {
				type: "",
				content: ""
			}
		},
		onLoad(options) {
			if (options.type) {
				this.type = options.type
				switch (options.type){
					case "user":
						uni.setNavigationBarTitle({
							title: "用户协议"
						})
						break;
					case "privacy": 
						uni.setNavigationBarTitle({
							title: "隐私政策"
						})
						break;
				}
			}
			this.getData()
		},
		methods: {
			async getData() {
				let res = await userAgree(this.type)
				this.content = res.data.agreement_content
			}
		}
	}
</script>

<style lang="scss">
	page {
		background-color: white;
	}
	.wrap {
		width: 100%;
		overflow: hidden;
		padding: 20rpx;
		padding-bottom: env(safe-area-inset-bottom);
		box-sizing: border-box;
		color: #252525;
		font-size: 34rpx;
		font-weight: bold;
	}
	
	
	
	

</style>